<?php
// Luu dieu kien loc theo linh vuc 
$v_current_item_id = '';
if(isset($_REQUEST['hdn_current_item_id'])){
	$v_current_item_id = $_REQUEST['hdn_current_item_id'];
}
if ($v_receive_date !=""){
	$v_receive_date_filter = $v_receive_date;
}else{
	$v_receive_date_filter = "";
}
if(isset($_REQUEST['hdn_received_date_filter'])){
	$v_receive_date_filter = $_REQUEST['hdn_received_date_filter'];
} 
if (!isset($_SESSION['staff_id'])||is_null(($_SESSION['staff_id']))){
	$v_staff_id = 0;
}
$v_order_clause = " ORDER BY C_CITIZEN_NAME";
if(_is_sqlserver()){
	$sql = "Exec Onegate_CustomerRecordGetAll";
	$sql = $sql . " " . $v_staff_id ;
	$sql = $sql . ",'" . $v_recordtype_filter . "'" ;
	$sql = $sql . ",'" ._ddmmyyyy_to_yyyymmdd($v_receive_date_filter) . "'" ;
	$sql = $sql . ",'" . $v_status_list."'" ;
	$sql = $sql . ",'" . $v_order_clause."'" ;
	//echo $sql; //exit;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$arr_all_record = $ado_conn->GetAll($sql);
}
?>